import { reqCourseDetail } from "../../api/courseIndex";
Page({
	data: {
		id:'',
		detail:'',
		info:'',
	},


	onLoad(p) {
		this.setData({id:p.id});
		this.getData();
	},
	onBack(){
		wx.navigateBack()
	},
	async getData(){
		let res = await reqCourseDetail({channelId:409,courseId:this.data.id})
		if(res.code == 1){		

			let detail =  res.data.detailDesc.replace(/<img style="/gi,'<img style="max-width:100%; ');
			detail =  detail.replace(/<img /gi,'<img style="max-width:100%;" ');
			this.setData({info:res.data,detail})
		}
	}
})